package gdkm.wsz.dao;

import gdkm.wsz.pojo.Employee;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface EmployeeDAO {
    @Select("select * from employee where id= #{id}")
    public Employee findById(Integer id);
    @Select("select * from employee where name= #{name}")
    public Employee findByName(String name);
    @Select("select * from employee")
    public List< Employee> findAll();
    @Insert("insert into employee(name,age,department_name,position_name,salary,hire_date,status,created_time,updated_time) values(#{name},#{age},#{department_name},#{position_name},#{salary},#{hire_date},#{status},#{created_time},#{updated_time})")
    public boolean save(Employee employee);
    @Update("update employee set name= #{name},age= #{age},department_name= #{department_name},position_name= #{position_name},salary= #{salary},hire_date= #{hire_date},status= #{status},created_time= #{created_time},updated_time= #{updated_time} where id= #{id}")
    public boolean update(Employee employee);
    @Delete("delete from employee where id= #{id}")
    public boolean delete(Integer id);

}
